#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e5 + 5;
ll n, a[N], cnt[N];
void tanxin(){
	ll Max = 0;
    for(ll i = 1; i <= n; i ++) cnt[a[i]] ++, Max = max(Max, a[i]);
   	ll L = 1, R = 1;
   	while(L < Max){
   		while(L < Max && cnt[L] == 0) L ++;
   		R = L + 1;
   		while(cnt[L]){
   			while(R <= Max && cnt[R] == 0) R ++;
   			if(R > Max) break;
   			ll x = min(cnt[L], cnt[R]);
   			cnt[L] -= x;
			R ++;
   		}
   		L ++;
   		if(R > Max) L = R;
   	}
    ll sum = 0;
    for(ll i = 1; i <= 1e5; i ++) sum += cnt[i];
    cout << sum << endl;
}
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w",  stdout);
    cin >> n;
    for(ll i = 1; i <= n; i ++) cin >> a[i];
    tanxin();
}
